{% block sw_users_permissions_detailed_additional_permissions %}
<mt-card
    class="sw-users-permissions-detailed-additional-permissions"
    position-identifier="sw-users-permissions-detailed-additional-permissions"
    :title="$tc('sw-users-permissions.roles.detailed-additional-permissions.title')"
>
    {% block sw_users_permissions_detailed_additional_permissions_additional_privileges %}
    <template
        v-for="privilege in detailedAdditionalPermissions"
        :key="privilege.key"
    >
        {% block sw_users_permissions_detailed_additional_permissions_additional_privileges_headline %}
        <h4
            :class="'sw-users-permissions-additional-permissions_' + privilege.key"
        >
            {% block sw_users_permissions_detailed_additional_permissions_additional_privileges_headline_content %}
            <strong>
                {{ $tc('sw-privileges.additional_permissions.' + privilege.key + '.label') }}
            </strong>
            {% endblock %}
        </h4>
        {% endblock %}

        {% block sw_users_permissions_detailed_additional_permissions_additional_privileges_switches %}
        <div
            class="sw-users-permissions-detailed-additional-permissions__switches"
        >
            {% block sw_users_permissions_detailed_additional_permissions_additional_privileges_switches_content %}
            <template
                v-for="(value, roleName) in privilege.roles"
                :key="roleName"
            >
                {% block sw_users_permissions_detailed_additional_permissions_additional_privileges_switches_content_switch %}

                <mt-switch
                    :class="'sw_users_permissions_detailed_additional_permissions_' + privilege.key + '_' + roleName"
                    :model-value="isEntitySelected(roleName)"
                    :disabled="isEntityDisabled(roleName) || disabled"
                    :label="roleName"
                    :bordered="true"
                    @update:model-value="changePermissionForEntity(roleName)"
                />
                {% endblock %}
            </template>
            {% endblock %}
        </div>
        {% endblock %}
    </template>
    {% endblock %}
</mt-card>
{% endblock %}
